<template>
  <div class="mpmp">
      <van-sticky>
      <Todaytop/>
       </van-sticky>
      <div class="ko">
           <img src="d1.png" alt="">
      </div>
     <div class="ok">
         <img src="d2.jpg" alt="">
     </div>
     <div class="oo"> 
         <ul class="xia">
         <Tz v-for="(v,i) in arra" :key="i" :cakeimage="v.cakeimage" :cakename="v.cakename" :brandname="v.brandname" :cakeprice="v.cakeprice" :cakeoriginal="v.cakeoriginal" :cakeingredients="v.cakeingredients" :scorenum="v.scorenum" :goodsid="v.goodsid" :typeid="v.typeid"/>
     </ul>
      <div class="okk">
         <img src="b3.jpg" alt="">
     </div>
     <ul class="xia2">
         <Tm v-for="(v,i) in arrb" :key="i" :cakeimage="v.cakeimage" :cakename="v.cakename" :brandname="v.brandname" :cakeprice="v.cakeprice" :cakeoriginal="v.cakeoriginal" :cakeingredients="v.cakeingredients" :send="v.send" :scorenum="v.scorenum" :goodsid="v.goodsid" :typeid="v.typeid"/>
     </ul>
     <div class="but">
           <span class="cha"><router-link to="/all/erx">查看更多</router-link></span>
     </div>
     </div>
    
  </div>
</template>

<script>
import Tz from "c/cakeC/todayzi.vue"
import Tm from "c/cakeC/tomm.vue"
import Todaytop from "@/components/cakeC/todaytop.vue"
import {getlink} from "a/getapi.js"
export default {
    data(){
        return{
            arra:[
                
            ],
            arrb:[],
        }
    },
    mounted(){
        getlink("http://180.76.121.47:8008/cake").then((ok)=>{
             ok.data.data.forEach((v)=>{
                if(v.typeid==1021){
                    this.arra.push(v)
                }
                if(v.typeid==1001){
                    this.arrb.push(v)
                }
            })
            if(this.$route.query.typeid=="001"){  
                this.$router.push("/brand/era")
            }
             if(this.$route.query.typeid=="002"){  
                this.$router.push("/brand2/era")
            }
            if(this.$route.query.typeid=="003"){  
                this.$router.push("/brand3/era")
            }
            if(this.$route.query.typeid=="004"){  
                this.$router.push("/brand4/era")
            }
            if(this.$route.query.typeid=="005"){  
                this.$router.push("/brand5/era")
            }
            if(this.$route.query.typeid=="006"){  
                this.$router.push("/brand6/era")
            }
            if(this.$route.query.typeid=="007"){
                this.$router.push("/brand7/era")
            }
            
           
            
        })
        // console.log(this.$route.query.typeid)
            
    },
    components:{
        Tz,
        Tm,
        Todaytop
    }
}
</script>

<style scoped>

.ko{
    width: 3.75rem;
    height: 1.84rem;
}
.ko img,.ok img,.okk img{
    display:block;
    width: 100%;
    height: 100%;
}
.ok,.okk{
    width: 3.75rem;
    height: 0.6rem;
}
.okk{
    margin-top:0.04rem;
    /* margin-bottom:0.04rem */
}
.oo{
     padding: 0.04rem;
     background-color: #f9f9f9;
}
.xia,.xia2{
    margin:0 auto;
    width:100%;
    margin-top: 0.04rem;
    overflow-x: none;
    background-color: #f9f9f9;
}
.but{
    margin: 0.25rem 0.6rem;
}
.cha{
    font-size:0.16rem;
    height: 0.44rem;
    display: block;
    width: 100%;
    border-radius: 0.22rem;
    border: #e8e8e8 1px solid;
    color: rgba(0, 0, 0, 0.54);
    text-align:center;
    line-height:0.44rem
}
</style>